<?php

namespace App\Library\Logic;

use App\Models\ShopImagesModel;

class ShopImageLogic extends ShopImagesModel
{
    /**
     * updateByWhereOfIds
     * @param array $where
     * @param array|null $ids
     * @return void
     */
    public static function updateByWhereOfIds(array $where, ?array $ids = null): void
    {
        $builder = self::query()->where(humpToLine($where));
        if(is_array($ids))$builder->whereNotIn('img_id', $ids);
        $builder->update(['img_source_id' => 0]);
    }
}
